<template>
	<view :data-theme="theme">
		<view v-if="orderInfo" class='order-details'>
			<!-- 给header上与data上加on为退款订单-->
			<view class='header bg_color' :class='isGoodsReturn ? "on":""'>
				<view class='picTxt acea-row row-middle'>
					<view class='data' :class='isGoodsReturn ? "on":""'>
						<view class='state'>{{orderInfo.orderStatusMsg}}</view>
						<view v-if="orderInfo.refundReasonTime !== null">{{orderInfo.refundReasonTime}}</view>
						<view v-else>支付时间：{{orderInfo.payTimeDesc ? orderInfo.payTimeDesc :''}}</view>
					</view>
				</view>
			</view>
			
			<view class="cell-content" style="margin-top: -60px;">
				<view v-if="!orderInfo.returnDate" class="">
					<view v-if="orderInfo.linePlan.planType==2" class="plan_type_class row-center">
						<text>流水班(滚动发车)</text>
					</view>
					<view v-if="orderInfo.linePlan.planType==3&&orderInfo.linePlan.isMust==0" class="plan_type_class row-center">
						<text>预约班，</text>
						<text>需预约满{{orderInfo.lowestNum}}人发车</text>
					</view>
					<view v-if="orderInfo.linePlan.planType==3&&orderInfo.linePlan.isMust==1" class="plan_type_class row-center">
						<text>已众筹拼车成功</text>
					</view>
					<view v-if="orderInfo.linePlan.planType!=2" style="color: #818181;margin-bottom: 12px;">{{orderInfo.dateDesc}} 发车</view>
					<view v-else style="color: #818181;margin-bottom: 12px;">{{orderInfo.dateDesc}} 前乘车</view>
					<view class="row">
						<view class="display-flex-column" style="align-items: center;">
							<view class="dot_grey2"></view>
							<view class="shu-line2" style=";"></view>
							<view class="dot_grey2"></view>
						</view>
						<view class="display-flex-column" style="margin: 0 8px;color: #000;width: 90%;">
							<view class="row-center" style="margin-top: -6px;">
								<text>{{orderInfo.onStopName}}</text>
							</view>
							<view class="" style="height: 26px;"></view>
							<view class="">{{orderInfo.offStopName}}</view>
						</view>
					</view>
				</view>
				<view v-if="orderInfo.returnDate" class="">
					<view class="row-center" style="color: #818181;margin-bottom: 8px;">
						<view class="go-item">去</view>{{orderInfo.dateDesc}} 发车
					</view>
					<view class="row">
						<view class="display-flex-column" style="align-items: center;">
							<view class="dot_grey2"></view>
							<view class="shu-line2" style=";"></view>
							<view class="dot_grey2"></view>
						</view>
						<view class="display-flex-column" style="margin: 0 8px;color: #000;width: 90%;">
							<view class="row-center" style="margin-top: -6px;">
								<text>{{orderInfo.onStopName}}</text>
							</view>
							<view class="" style="height: 26px;"></view>
							<view class="">{{orderInfo.offStopName}}</view>
						</view>
					</view>
				
					<view class="row-center" style="color: #818181;margin-bottom: 8px;margin-top: 10px;">
						<view class="back-item">返</view>
						{{orderInfo.returnDateDesc}} 发车
					</view>
					<view class="row">
						<view class="display-flex-column" style="align-items: center;">
							<view class="dot_grey2"></view>
							<view class="shu-line2" style=";"></view>
							<view class="dot_grey2"></view>
						</view>
						<view class="display-flex-column" style="margin: 0 8px;color: #000;width: 90%;">
							<view class="row-center" style="margin-top: -6px;">
								<text>{{orderInfo.offStopName}}</text>
								<!-- 	<view class="" style="margin-left: auto;margin-right: 12px;">
									<text class="iconfont icondizhi2" style="margin-right: 3px;"></text>
									<text>导航</text>
								</view> -->
							</view>
							<view class="" style="height: 26px;"></view>
							<view class="">{{orderInfo.onStopName}}</view>
						</view>
					</view>
				</view>
				<view v-if="orderInfo.paid&&orderInfo.checkTicketType==2&&!isCaptureScreen&&orderInfo.refundStatus!=1&&orderInfo.refundStatus!=2" class="tickets-way-box">
					<view class="tickets-qrcode">
						<view class="title-box display-flex">
							<view class="title">
								无需取票，扫码乘车
							</view>
						</view>
						<view class="qrcdoe-box">
							<view class="qrcode-item" @click="qrcodeShow=true">
								<view class="pictrue">
									<image :src="codeImg"></image>
								</view>
								<text class="maxglass"></text>
							</view>
							<view class="ticket-info">
								{{orderInfo.linePlan.verifyCode}}
							</view>
						</view>
				
					</view>
				</view>
				<view v-if="orderInfo.checkTicketType==2&&isCaptureScreen&&orderInfo.refundStatus!=1&&orderInfo.refundStatus!=2" class="qrcode-container display-flex-column">
					<view style="color: #000000;font-weight: 600;font-size: 16px;margin: 12px 0;">乘车二维码</view>
					<icon type="warn" size="40" style="margin:15px 0;" />
					<text style="font-size: 16px;color: #000;font-weight: 600;margin-bottom: 10px;">请勿截图使用二维码</text>
					<text style="color: #878787;font-size: 10px;">仅限本人使用，截图使用经核实将会影响功能</text>
					<button @click="showTicketAgain" plain type="error" >知道了</button>
				</view>
				<view v-if="orderInfo.paid&&orderInfo.checkTicketType==1&&orderInfo.refundStatus!=1&&orderInfo.refundStatus!=2" class="tickets-dynamic-box">		
					<scBg v-if="orderInfo.isCanCheck" :type="2" :height="400" :width="600">
						
						<view class="display-flex-column" style="align-items: center;">
							<view  v-if="orderInfo.isCanCheck&&orderInfo.isUse" style="margin: 30px 0 10px 0;font-size: 55px;">
								{{orderInfo.linePlan.verifyCode}}
							</view>
							<view v-if="orderInfo.isCanCheck&&!orderInfo.isUse" class="">
								<button  @click="Yan()" class="button-k font-color-weak"
									  style="margin-top: 40px;margin-bottom: 20px;padding: 6px 8px;">
								   点击验票
								</button>
							</view>
							<view class="" style="margin-top: 20px;font-size: 30px;font-weight: 700;">
								{{time}}
							</view>
						</view>
					</scBg>
					
					<view v-if="!orderInfo.isCanCheck" class="qr-tip no-qrCode">
						<view class="no-qrCode-text">乘车码于发车前{{orderInfo.line.checkTime}}分钟显示…</view>
						<image class="no-code-img" src="https://qiniu.gybsky.cn/qsbsimage/public/maintain/2022/08/31/08e9f2004eac4f74978a13a18e54d944hu95f6n53a.png"></image>
					</view>
				</view>
			</view>
			<view v-if="orderInfo.line&&orderInfo.line.isPassenger" class="cell-content ">
				<view style="color: #999999;">乘车人</view>
				<view class="">
					<view class="row-center" style="margin: 5px 12px;" v-for="(item, index) in orderInfo.passengerList" :key=index>
						<text style="font-size: 14px;color: #000000;font-weight: 600;width: 70px;">{{item.name}}</text>
						<text style="color: #909090;font-size: 12px;margin: 0 5px;margin-right: 25px;">{{item.idCard.substr(0,4) + "**********" + item.idCard.substr(14),}}</text>
						<view class="" style="padding:0 2px;line-height: 20px;height: 20px;background-color: #e4f4ff;color: #b5cdff;text-align: center;margin-right: 10px;">
							{{item.type==1?'成人票':'儿童票'}}
						</view>
		
					</view>
					<view class="separation-line" style="margin: 12px;">
		
					</view>
				</view>
				<view class="">
					<text style="color: #999;margin-right: 10px;">联系手机</text>
					<text style="color: #000;">{{orderInfo.userPhone}}</text>
				</view>
			</view>
			<view v-if="orderInfo.line&&!orderInfo.line.isPassenger" class="cell-content">
				<view class="display-flex">
					<text style="color: #999;margin-right: 10px;">乘车人</text>
					
					<text class="row-center" >
						{{orderInfo.passengerNum}}人乘坐
					</text>
					
				</view>
				<view class="separation-line" style="margin: 12px;">
				</view>
				<view class="">
					<text style="color: #999;margin-right: 10px;">联系手机</text>
					<text style="color: #000;">{{orderInfo.userPhone}}</text>
				</view>
			</view>
			
			<view>
				<!-- 游客 -->
				<!-- #ifndef MP -->
				<div class="goodCall borRadius14" @click="openWxKf">
					<span class="iconfont icon-kefu"></span><span>联系客服</span>
				</div>
				<!-- #endif -->
				<!-- #ifdef MP -->
				<div class="goodCall borRadius14">
					<button hover-class='none' @click="kefuClick" v-if="chatConfig.telephone_service_switch === 'true'">
						<span class="iconfont icon-kefu"></span><span>联系客服</span>
					</button>
					<view @click="openWxKf" hover-class='none' v-else>
						<span class="iconfont icon-kefu"></span><span>联系客服</span>
					</view>
				</div>
				<!-- #endif -->
			</view>
			
			<view class="pad30">
				
				<view class='wrapper borRadius14'>
					<view class='item acea-row row-between'>
						<view>订单编号：</view>
						<view class='conter acea-row row-middle row-right'><text class="text-overflow">{{orderInfo.orderId}}</text>
							<!-- #ifndef H5 -->
							<text class='copy' @tap='copy'>复制</text>
							<!-- #endif -->
							<!-- #ifdef H5 -->
							<text class='copy copy-data' :data-clipboard-text="orderInfo.orderId">复制</text>
							<!-- #endif -->
						</view>
					</view>
					<view class='item acea-row row-between'>
						<view>下单时间：</view>
						<view class='conter'>{{(orderInfo.addTimeDesc || 0)}}</view>
					</view>
					<view class='item acea-row row-between'>
						<view>支付状态：</view>
						<view class='conter' v-if="orderInfo.paid">已支付</view>
						<view class='conter' v-else>未支付</view>
					</view>
					<view class='item acea-row row-between'>
						<view>支付方式：</view>
						<view class='conter'>{{orderInfo.payTypeStr}}</view>
					</view>
					<view class='item flex justify-between align-center' v-if="orderInfo.mark && orderInfo.mark.length <= 15">
						<view>买家留言：</view>
						<view class='conter' >{{orderInfo.mark}}</view>
					</view>
					<view class='item flex justify-between' v-if="orderInfo.mark && orderInfo.mark.length > 15">
						<view>买家留言：</view>
						<view class="flex align-center" v-show="isShow" @click="isShow=!isShow">
							<view class='conter' >{{orderInfo.mark}}</view>
							<text class="iconfont icon-xiangyou" style="font-size: 12px;"></text>
						</view>
						<view v-show="!isShow" @click="isShow=!isShow">
							<view class='mark_show' >{{orderInfo.mark}}</view>
						</view>
					</view>
				</view>
				<!-- 退款订单详情 "-->
				<view v-if="isGoodsReturn" class='wrapper borRadius14' >
					<view class='item acea-row row-between'>
						<view>联系电话：</view>
						<view class='conter'>{{orderInfo.userPhone}}</view>
					</view>
					<view class='item acea-row row-between' v-if="orderInfo.refundReasonWap">
						<view>退款原因：</view>
						<view class='conter'>{{orderInfo.refundReasonWap}}</view>
					</view>
					<view class='item acea-row row-between' v-if="orderInfo.refundReasonWapExplain">
						<view>退款说明：</view>
						<view class='conter'>{{orderInfo.refundReasonWapExplain}}</view>
					</view>
				</view>
			
				<view class='wrapper borRadius14'>
					<view class='item acea-row row-between'>
						<view>产品总价：</view>
						<view class='conter'>￥{{orderInfo.payPrice}}</view>
					</view>
	
					<view class='item acea-row row-between' v-if='orderInfo.couponId'>
						<view>优惠券抵扣：</view>
						<view class='conter'>-￥{{orderInfo.couponPrice}}</view>
					</view>
					<view class='item acea-row row-between' v-if="orderInfo.useIntegral > 0">
						<view>积分抵扣：</view>
							<view class='conter'>-￥{{orderInfo.deductionPrice}}</view>
					</view>
					<view class='actualPay acea-row row-right'>实付款：<text
							class='money'>￥{{orderInfo.payPrice}}</text></view>
				</view>
				<view style='height:120rpx;'></view>
				<view class='footer acea-row row-right row-middle' v-if="isGoodsReturn==false">
					<view class="qs-btn" v-if="!orderInfo.paid" @click.stop="cancelOrder">取消订单</view>
					<view class='bnt bg_color' v-if="!orderInfo.paid" @tap='pay_open(orderInfo.orderId)'>立即付款</view>
					<view @click="goRefund"	class='bnt cancel' v-else-if="orderInfo.paid === true && orderInfo.refundStatus === 0 ">申请退款
					</view>
					<view @click="goHome" class="refund_button">
						再次购买
					</view>

				</view>
			</view>


		</view>
		
		<!-- <home></home> -->
		<apopup  :show="qrcodeShow" @close="qrcodeShow=false" type="center" :closeable="false" border-radius="8">
			
			<view class="" style="display: flex; justify-content: center;">
				<view class="" style="height: 200px;width: 200px;">
					<image style="width: 100%;height: 100%;" :src="codeImg"></image>
				</view>
			</view>
		</apopup>
		<!-- #ifdef MP -->
		<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
		<!-- #endif -->
		<payment :payMode='payMode' :type="2" :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id"
			:totalPrice='totalPrice'></payment>
	</view>
</template>
<script>
	import {
		openKf
	} from "@/utils";
	import {
		getOrderBusDetail,
		orderBusCancel,
		qrcodeApi,
		orderBusVerific,
		orderBusRefundVerify,
	} from '@/api/order.js';
	import apopup from '@/components/a-popup/index.vue';
	import home from '@/components/home';
	import payment from '@/components/payment';
	import orderGoods from "@/components/orderGoods";
	import ClipboardJS from "@/plugin/clipboard/clipboard.js";
	import {toLogin} from '@/libs/login.js';
	import {mapGetters} from "vuex";
	// #ifdef MP
	import authorize from '@/components/Authorize';
	import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
	// #endif
	import {setThemeColor} from '@/utils/setTheme.js'
	import {Debounce} from '@/utils/validate.js'
	
	import scBg from '@/components/bg/index'
	
	const app = getApp();
	export default {
		components: {
			payment,
			home,
			scBg,
			orderGoods,
			apopup,
			// #ifdef MP
			authorize
			// #endif
		},
		data() {
			return {
				qrcodeShow: false,
				time: '',
				isCaptureScreen: false,
				codeImg: '',
				qrcodeSize: 100,
				order_id: '',
				evaluate: 0,
				cartInfo: [], //购物车产品
				orderInfo: '', //订单详情
				system_store: {},
				isGoodsReturn: false, //是否为退款订单
				status: {}, //订单底部按钮状态
				isClose: false,
				payMode: [
					// #ifdef MP-WEIXIN || APP-PLUS
					{
						"name": "微信支付",
						"icon": "icon-weixin2",
						value: 'weixin',
						title: '微信快捷支付',
						payStatus: 1,
					},
					// #endif
					// #ifdef MP-ALIPAY || APP-PLUS
					{
						"name": "支付宝支付",
						"icon": "icon-zhifubao",
						value: 'alipay',
						title: '支付宝快捷支付',
						payStatus: 1,
					},
					
					 // #endif
					{
						"name": "余额支付",
						"icon": "icon-yuezhifu",
						value: 'yue',
						title: '可用余额:',
						payStatus: 1,
					},
				],
				pay_close: false,
				pay_order_id: '',
				totalPrice: '0',
				isAuto: false, //没有授权的不会自动授权
				isShowAuth: false, //是否隐藏授权
				id: 0, //订单id
				uniId: '',
				utils: this.$util,
				againStatus:0,
				type: 'normal',
				isShow:true,
				theme:app.globalData.theme,
				bgColor:'#e93323',
				chatConfig:{
					consumer_hotline:'',
					telephone_service_switch:'false'
				} //客服配置
			};
		},
		computed: mapGetters(['isLogin', 'chatUrl', 'userInfo']),
		onLoad: function(options) {
			
			options.type == undefined || options.type == null ? this.type = 'normal' : this.type = options.type;
			if (!options.order_id && !options.uniId) return this.$util.Tips({
				title: '缺少参数'
			}, {
				tab: 3,
				url: 1
			});
			this.$set(this, 'order_id', options.order_id);
			let that = this;
			// #ifndef H5
			uni.onUserCaptureScreen(function() {
				that.isCaptureScreen = true
			});
			// #endif
			// #ifndef H5
			that.isCaptureScreen = false
			// #endif
			
			that.bgColor = setThemeColor();
			uni.setNavigationBarColor({
				frontColor: '#ffffff',
				backgroundColor:that.bgColor,
			});
			that.$set(that,'chatConfig',that.$Cache.getItem('chatConfig'));
		},
		onShow() {
			var that = this
			if (this.isLogin) {
				this.getOrderInfo();
				this.payMode[1].number = this.userInfo.nowMoney;
				this.$set(this, 'payMode', this.payMode);
			} else {
				toLogin();
			}
			
			var timerID = setInterval(function() {
				that.updateTime()
			}, 1000);
			that.updateTime()
		},
		onHide: function() {
			this.isClose = true;
		},
		onReady: function() {
			// #ifdef H5
			this.$nextTick(function() {
				const clipboard = new ClipboardJS(".copy-data");
				clipboard.on("success", () => {
					this.$util.Tips({
						title: '复制成功'
					});
				});
			});
			// #endif
			 
		},
		mounted() {
			// #ifdef H5
			if(this.$wechat.isWeixin()) this.payMode.pop();
			// #endif
		},
		onPullDownRefresh() {
			var that = this;
			var timerID = setInterval(function() {
				that.updateTime()
			}, 1000);
			that.updateTime()
		},
		methods: {
			kefuClick() {
				if(this.chatConfig.telephone_service_switch === 'true'){
					uni.makePhoneCall({
					    phoneNumber: this.chatConfig.consumer_hotline //仅为示例
					});
				}else{
					// #ifdef APP-PLUS
					uni.navigateTo({
						url: '/pages/users/web_page/index?webUel=' + this.chatUrl + '&title=客服'
					})
					// #endif
					// #ifndef APP-PLUS
					location.href = this.chatUrl;
					// #endif
				}
			},
			/**
			 * 事件回调
			 * 
			 */
			onChangeFun: function(e) {
				let opt = e;
				let action = opt.action || null;
				let value = opt.value != undefined ? opt.value : null;
				(action && this[action]) && this[action](value);
			},
			/**
			 * 拨打电话
			 */
			makePhone: function() {
				uni.makePhoneCall({
					phoneNumber: this.system_store.phone
				})
			},
			
			updateTime: function() {
				var cd = new Date();
				this.time = this.zeroPadding(cd.getHours(), 2) + ':' + this.zeroPadding(cd.getMinutes(), 2) + ':' + this.zeroPadding(
						cd.getSeconds(), 2),
					this.date = this.zeroPadding(cd.getFullYear(), 4) + '-' + this.zeroPadding(cd.getMonth() + 1, 2) + '-' + this.zeroPadding(
						cd.getDate(), 2)
			
			},
			zeroPadding(num, digit) {
				var zero = '';
				for (var i = 0; i < digit; i++) {
					zero += '0';
				}
				return (zero + num).slice(-digit);
			},
			/**
			 * 打开地图
			 * 
			 */
			showMaoLocation: function() {
				if (!this.system_store.latitude || !this.system_store.longitude) return this.$util.Tips({
					title: '缺少经纬度信息无法查看地图！'
				});
				uni.openLocation({
					latitude: parseFloat(this.system_store.latitude),
					longitude: parseFloat(this.system_store.longitude),
					scale: 8,
					name: this.system_store.name,
					address: this.system_store.address + this.system_store.detailedAddress,
					success: function() {

					},
				});
			},
			/**
			 * 关闭支付组件
			 * 
			 */
			payClose: function() {
				this.pay_close = false;
			},
			/**
			 * 打开支付组件
			 * 
			 */
			pay_open: function() {
				this.pay_close = true;
				this.pay_order_id = this.orderInfo.orderId;
				this.totalPrice = this.orderInfo.payPrice;
			},
			/**
			 * 支付成功回调
			 * 
			 */
			pay_complete: function() {
				this.pay_close = false;
				this.pay_order_id = '';
				this.getOrderInfo();
			},
			openWxKf(){
				openKf()
			
			
			},
			
			confirmRefund(){
				let that = this
				uni.showLoading({
					title:'请稍后...'
				})
				
				orderBusRefundVerify({
					text:  '用户自主退款',
					refund_reason_wap_explain: '用户自主退款',
					refund_reason_wap_img: '',
					uni: that.orderInfo.orderId
				}).then(res => {
					uni.hideLoading()
					that.getOrderInfo()
					return this.$util.Tips({
						title: '申请成功',
						icon: 'success'
					});
				}).catch(err => {
					uni.hideLoading()
					that.getOrderInfo()
					return this.$util.Tips({
						title: err
					});
				})
			},
			goRefund(){
				var that = this
				uni.showModal({
					title: '确认退票',
					content: '确认退票？退票成功后票款会在7个工作日返回原账户!',
					success: function(res) {
						if (res.confirm) {
							 that.confirmRefund()
							}
						}
				})
			},
			
			goHome: function() {
				uni.redirectTo({
					url: '/pages/index/index'
				})
			},
			/**
			 * 支付失败回调
			 * 
			 */
			pay_fail: function() {
				this.pay_close = false;
				this.pay_order_id = '';
			},
			/**
			 * 登录授权回调
			 * 
			 */
			onLoadFun: function() {
				this.getOrderInfo();
			},
			/**
			 * 获取订单详细信息
			 * 
			 */
			getOrderInfo: function() {
				let that = this;
				uni.showLoading({
					title: "正在加载中"
				});
				getOrderBusDetail(that.order_id).then(res => {
					uni.hideLoading();
					that.$set(that, 'orderInfo', res.data);
					if(res.data.passengerList&&res.data.passengerList!='[]'){
						that.orderInfo.passengerList = JSON.parse(res.data.passengerList.replace("id_card","idCard"))
					}

					that.$set(that, 'evaluate', res.data.status == 2 ? 2 : 0);
					that.$set(that, 'id', res.data.id);
					if (res.data.refundStatus != 0) {
						that.isGoodsReturn = true;
					};
					 
					if(that.orderInfo.refundStatus>0){
						uni.setNavigationBarColor({
						    frontColor: '#fff',
						    backgroundColor: '#666666'
						})
					}	
					if (that.orderInfo.paid) that.markCode(res.data.verifyCode);
				}).catch(err => {
					that.$util.Tips({
						title: err
					},{
						tab: 4,
						url: '/pages/index/index'
					});
				});
			},
			/**
			 * 
			 * 生成二维码
			 */
			markCode(text) {
				qrcodeApi({
					height: '145',
					text: text,
					width: '145'
				}).then(res => {
					this.codeImg = res.data.code
				});
			},
			/**
			 * 
			 * 剪切订单号
			 */
			// #ifndef H5
			copy: function() {
				let that = this;
				uni.setClipboardData({
					data: this.orderInfo.orderId
				});
			},
			// #endif
			/**
			 * 打电话
			 */
			goTel: function() {
				uni.makePhoneCall({
					phoneNumber: this.orderInfo.deliveryId
				})
			},
			confirmTicket(){
				let self = this
				if (!this.orderInfo.verifyCode) return self.$util.Tips({
					title: '请输入正确的核销码'
				});
				uni.showLoading({
					title:'请稍后...'
				})
				setTimeout(() => {
					orderBusVerific(this.orderInfo.orderId)
						.then(res => {
							uni.hideLoading()
							self.getOrderInfo()
							return self.$util.Tips({
								title: '验票成功'
							})
						})
						.catch(res => {
							uni.hideLoading()
							self.getOrderInfo()
							return self.$util.Tips({
								title: res
							});
						});
				}, 800);
			},
			Yan(){
				var that = this
				uni.showModal({
					title: '确认验票',
					content: '确认验票？请确认车辆已到达!验票成功后将不能退票!',
					success: function(res) {
						if (res.confirm) {
							 that.confirmTicket()
							}
						}
				})
			},
			
			// 重新刷新票
			showTicketAgain: function() {
				this.isCaptureScreen = false
			},
			

			cancelOrder:Debounce(function(){
				let self = this
				uni.showModal({
					title: '提示',
					content: '确认取消该订单?',
					success: function(res) {
						if (res.confirm) {
							orderBusCancel(self.orderInfo.id)
								.then((data) => {
									self.$util.Tips({
										title: '取消成功'
									}, {
									tab: 4,
									url: '/pages/index/index'
								   })
								}).catch((err) => {
									self.$util.Tips({
										title: err
									})
									self.getDetail();
								});
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			}) 
		}
	}
</script>

<style scoped lang="scss">
	.qs-btn {
		width: auto;
		height: 60rpx;
		text-align: center;
		line-height: 60rpx;
		border-radius: 50rpx;
		color: #fff;
		font-size: 27rpx;
		padding: 0 3%;
		color: #aaa;
		border: 1px solid #ddd;
		margin-right: 20rpx;
	}
	.text-overflow{
		width: 300rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.shuoming{
		width: 32rpx;
		height: 32rpx;
	}
	.mp-header{
		width: 100%;
		@include main_bg_color(theme);
	}
	.goodCall {
		@include main_color(theme);
		text-align: center;
		width: 100%;
		height: 86rpx;
		padding: 0 30rpx;
		border-bottom: 1rpx solid #eee;
		font-size: 30rpx;
		line-height: 86rpx;
		background: #fff;

		.icon-kefu {
			font-size: 36rpx;
			margin-right: 15rpx;
		}

		/* #ifdef MP */
		button {
			display: flex;
			align-items: center;
			justify-content: center;
			height: 86rpx;
			font-size: 30rpx;
			@include main_color(theme);
		}

		/* #endif */
	}
	.justify-between {
		justify-content: space-between;
	}
	.align-center{
		align-items: center;
	}
	.order-details .header {
		height: 250rpx;
		padding: 0 30rpx;
	}
	.bg_color{
		@include main_bg_color(theme);
	}
	.to_bottom_color{
		@include to-bottom-gradient(theme);
	}
	.order-details .header.on {
		background-color: #666 !important;
	}

	.order-details .header .pictrue {
		width: 110rpx;
		height: 110rpx;
	}

	.order-details .header .pictrue image {
		width: 100%;
		height: 100%;
	}

	.order-details .header .data {
		color: rgba(255, 255, 255, 0.8);
		font-size: 24rpx;
		margin-left: 27rpx;
	}

	.order-details .header .data.on {
		margin-left: 0;
	}

	.order-details .header .data .state {
		font-size: 30rpx;
		font-weight: bold;
		color: #fff;
		margin-bottom: 7rpx;
	}

	.order-details .header .data .time {
		margin-left: 20rpx;
	}

	.picTxt {
		height: 150rpx;
	}

	.order-details .nav {
		background-color: #fff;
		font-size: 26rpx;
		color: #282828;
		padding: 27rpx 0;
		width: 100%;
		border-radius: 14rpx;
		margin: -100rpx auto 0 auto;
	}

	.order-details .nav .navCon {
		padding: 0 40rpx;
	}

	.order-details .nav .on {
		@include main_color(theme);
	}
	.font_color{
		@include main_color(theme);
	}
	.order-details .nav .progress {
		padding: 0 65rpx;
		margin-top: 10rpx;
	}

	.order-details .nav .progress .line {
		width: 100rpx;
		height: 2rpx;
		background-color: #939390;
	}

	.order-details .nav .progress .iconfont {
		font-size: 25rpx;
		color: #939390;
		margin-top: -2rpx;
	}

	.order-details .address {
		font-size: 26rpx;
		color: #868686;
		background-color: #fff;
		margin-top: 15rpx;
		padding: 30rpx 24rpx;
	}

	.order-details .address .name {
		font-size: 30rpx;
		color: #282828;
		margin-bottom: 15rpx;
	}

	.order-details .address .name .phone {
		margin-left: 40rpx;
	}

	.order-details .line {
		width: 100%;
		height: 3rpx;
	}

	.order-details .line image {
		width: 100%;
		height: 100%;
		display: block;
	}
	.order-details .wrapper {
		background-color: #fff;
		margin-top: 12rpx;
		padding: 30rpx 24rpx;
	}

	.order-details .wrapper .item {
		font-size: 28rpx;
		color: #282828;
	}

	.order-details .wrapper .item~.item {
		margin-top: 20rpx;
	}

	.order-details .wrapper .item .conter {
		color: #868686;
		width: 470rpx;
		text-align: right;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.mark_show{
		color: #868686;
		width: 470rpx;
		text-align: right;
	}
	.order-details .wrapper .item .conter .copy {
		font-size: 20rpx;
		color: #333;
		border-radius: 20rpx;
		border: 1rpx solid #666;
		padding: 3rpx 15rpx;
		margin-left: 24rpx;
	}

	.order-details .wrapper .actualPay {
		border-top: 1rpx solid #eee;
		margin-top: 30rpx;
		padding-top: 30rpx;
	}

	.order-details .wrapper .actualPay .money {
		font-weight: bold;
		font-size: 30rpx;
		@include price_color(theme);
	}

	.order-details .footer {
		width: 100%;
		height: 100rpx;
		position: fixed;
		bottom: 0;
		left: 0;
		background-color: #fff;
		padding: 0 30rpx;
		box-sizing: border-box;
	}

	.order-details .footer .bnt {
		width: 158rpx;
		height: 54rpx;
		text-align: center;
		line-height: 54rpx;
		border-radius: 50rpx;
		color: #fff;
		font-size: 27rpx;
	}

	.order-details .footer .bnt.cancel {
		color: #aaa;
		border: 1rpx solid #ddd;
	}

	.order-details .footer .bnt~.bnt {
		margin-left: 18rpx;
	}

	.order-details .writeOff {
		background-color: #fff;
		margin-top: 15rpx;
		padding-bottom: 50rpx;
	}

	.order-details .writeOff .title {
		font-size: 30rpx;
		color: #282828;
		height: 87rpx;
		border-bottom: 1px solid #f0f0f0;
		padding: 0 24rpx;
		line-height: 87rpx;
	}

	.order-details .writeOff .grayBg {
		background-color: #f2f5f7;
		width: 590rpx;
		height: 384rpx;
		border-radius: 20rpx 20rpx 0 0;
		margin: 50rpx auto 0 auto;
		padding-top: 55rpx;
	}

	.order-details .writeOff .grayBg .pictrue {
		width: 290rpx;
		height: 290rpx;
		margin: 0 auto;
	}

	.order-details .writeOff .grayBg .pictrue image {
		width: 100%;
		height: 100%;
		display: block;
	}

	.order-details .writeOff .gear {
		width: 590rpx;
		height: 30rpx;
		margin: 0 auto;
	}

	.order-details .writeOff .gear image {
		width: 100%;
		height: 100%;
		display: block;
	}

	.order-details .writeOff .num {
		background-color: #f0c34c;
		width: 590rpx;
		height: 84rpx;
		color: #282828;
		font-size: 48rpx;
		margin: 0 auto;
		border-radius: 0 0 20rpx 20rpx;
		text-align: center;
		padding-top: 4rpx;
	}

	.order-details .writeOff .rules {
		margin: 46rpx 30rpx 0 30rpx;
		border-top: 1px solid #f0f0f0;
		padding-top: 10rpx;
	}

	.order-details .writeOff .rules .item {
		margin-top: 20rpx;
	}

	.order-details .writeOff .rules .item .rulesTitle {
		font-size: 28rpx;
		color: #282828;
	}

	.order-details .writeOff .rules .item .rulesTitle .iconfont {
		font-size: 30rpx;
		color: #333;
		margin-right: 8rpx;
		margin-top: 5rpx;
	}

	.order-details .writeOff .rules .item .info {
		font-size: 28rpx;
		color: #999;
		margin-top: 7rpx;
	}

	.order-details .writeOff .rules .item .info .time {
		margin-left: 20rpx;
	}

	.order-details .map {
		height: 86rpx;
		font-size: 30rpx;
		color: #282828;
		line-height: 86rpx;
		border-bottom: 1px solid #f0f0f0;
		margin-top: 15rpx;
		background-color: #fff;
		padding: 0 24rpx;
	}

	.order-details .map .place {
		font-size: 26rpx;
		width: 176rpx;
		height: 50rpx;
		border-radius: 25rpx;
		line-height: 50rpx;
		text-align: center;
	}

	.order-details .map .place .iconfont {
		font-size: 27rpx;
		height: 27rpx;
		line-height: 27rpx;
		margin: 2rpx 3rpx 0 0;
	}

	.order-details .address .name .iconfont {
		font-size: 34rpx;
		margin-left: 10rpx;
	}

	.refund {
		padding:  0 !important;
		margin-top: 15rpx;
		background-color: #fff;

		.title {
			display: flex;
			align-items: center;
			font-size: 30rpx;
			color: #333;
			height: 86rpx;
			border-bottom: 1px solid #f5f5f5;
            font-weight: 400;
			padding: 0 24rpx;
			
			image {
				width: 32rpx;
				height: 32rpx;
				margin-right: 10rpx;
			}
		}

		.con {
			font-size: 26rpx;
			color: #666666;
			padding: 30rpx 24rpx;
		}
	}
	
	.cell-content {
		margin: 15px 15px 0 15px;
		background-color: #FFFFFF;
		border-radius: 6px;
		padding: 12px;
	
	}
	
	
	.tickets-way-box {
		background: #fff;
		margin: 0 4px;
		margin-top: 8px;
		border-radius: 4px;
	}
	
	.tickets-qrcode {
		border-radius: 8px;
		overflow: hidden;
	}
	
	.tickets-no-qrcode {
		border-radius: 8px;
		overflow: hidden;
	}
	
	.tickets-way-box .title-box {
		background-color: #e7fff2;
		padding: 6px 9px;
		justify-content: center;
	}
	
	.tickets-way-box .title-box .title {
		font-size: 12px;
		color: #999;
	}
	
	.tickets-way-box .qrcdoe-box {
		background-color: #f5fff9;
		text-align: center;
		border-radius: 20rpx 20rpx 0 0;
		padding-top: 55rpx;
		position: relative;
	}
	
	.pictrue {
		width: 200rpx;
		height: 200rpx;
	}
	
	.pictrue image {
		width: 100%;
		height: 100%;
		display: block;
	}
	
	.ticket-info {
		text-align: center;
		color: #282828;
		font-size: 20px;
		padding: 15px 0;
		margin-right: 18px;
	}
	
	.maxglass {
		display: inline-block;
		background: url() no-repeat center;
		background-size: 100% 100%;
		width: 18px;
		height: 20px;
		margin-left: 5px;
	}
	
	.qrcode-item {
		display: flex;
		margin: 0 auto;
		align-items: baseline;
		justify-content: center;
	}
	
	.qrcode-container {
		background-color: #FFF;
		border-radius: 8rpx;
		margin: 20px 30px;
		text-align: center;
	}
	
	.qr-tip,
	.qrcode-img {
		width: 400rpx;
		height: 400rpx;
	}
	
	.qr-tip {
		display: flex;
		-webkit-box-pack: center;
		justify-content: center;
		-webkit-box-align: center;
		align-items: center;
		font-size: 28rpx;
	}
	
	.no-qrCode {
		color: #666;
		font-size: 24rpx;
		position: relative;
	}
	
	.no-qrCode-text {
		z-index: 10;
		background: hsla(0, 0%, 100%, .95);
		line-height: 400rpx;
		text-align: center;
	}
	
	.no-code-img,
	.no-qrCode-text {
		position: absolute;
		width: 400rpx;
		height: 400rpx;
	}
	
	.no-code-img {
		top: 0;
		left: 0;
		z-index: 1;
	}
	
	.tickets-dynamic-box {
		display: flex;
		flex-direction: column;
		align-items: center;
	}
	
	.button-k {
		border-radius: 36rpx;
		border: 2rpx solid #26a2ff;
		font-size: 32rpx;
		display: inline-block;
		color: #26A2FF;
	}
	.plan_type_class {
		color: rgb(0, 122, 255);
		margin-top: 2px;
		padding: 0px 4px;
		height: 20px;
		border: 1px solid rgb(66, 151, 255);
		border-radius: 3px;
		line-height: 20px;
		font-size: 10px;
		font-weight: 400;
		width: fit-content;
		margin-bottom: 10px;
	}
	.go-item {
		border-radius: 5px;
		background-color: #1f73d9;
		color: #FFFFFF;   
		 width: 20px; 
		 height: 20px;
		 text-align: center;
		 margin-right: 5px;
		 font-size: 12px;
		 line-height: 20px;
	}
	.back-item {
		border-radius: 5px;
		background-color: #ff5303;
		color: #FFFFFF;   
		 width: 20px; 
		 height: 20px;
		 text-align: center;
		 margin-right: 5px;
		 font-size: 12px;
		 line-height: 20px;
	}
	.no-active{
		width: 27%;
		height: 35px;
		border-radius: 5px;
		border: 1px solid #e5e5e5;
		margin: 0 15px 10px 0;
		text-align: center;
		line-height: 35px;
		position: relative;
	}
	.in-active{
		width: 27%;
		height: 35px;
		border-radius: 5px;
		border: 1px solid #0c79ff;
		margin: 0 15px 10px 0;
		text-align: center;
		line-height: 35px;
		position: relative;
	}
	.gou {
		position: absolute;
		float: right;
		right: 0;
		background-color: #0c79ff;
		width: 15px;
		height: 10px;
		line-height: 10px;
		bottom: 0;
		border-bottom-right-radius: 3px;
		border-top-left-radius: 5px;
	}
	.content {
		padding: 24rpx;
		text-align: center;
	}
	.refund_button {
		width: 158rpx;
		height: 54rpx;
		text-align: center;
		line-height: 54rpx;
		border-radius: 50rpx;
		color: #fff;
		font-size: 27rpx;
		color: #aaa;
		border: 1rpx solid #ddd;
		margin-left: 4px;
	
	}
</style>